package flow.action;

import java.awt.event.MouseEvent;

import javax.swing.event.MouseInputAdapter;

import flow.Grapher;
import flow.base.MyPoint;

public class MouseHandler extends MouseInputAdapter {
	public MouseHandler() {
	}
	
	public void mouseRightClicked(MouseEvent e){
		Grapher.flowGraphEngine.getCanvas().mouseRightClick(new MyPoint(e.getPoint().x,e.getPoint().y));
		
	}
	
	
	/*public void mousePressed(MouseEvent e) {
		Grapher.flowGraphEngine.getCanvas().mouseLeftClick(new MyPoint(e.getPoint().x,e.getPoint().y));
	}*/

	public void mouseReleased(MouseEvent e) {
		Grapher.flowGraphEngine.getCanvas().mouseReleased(new MyPoint(e.getPoint().x,e.getPoint().y));
	}

	public void mouseDragged(MouseEvent e) {
		Grapher.flowGraphEngine.getCanvas().mouseDrag(new MyPoint(e.getPoint().x,e.getPoint().y));
		
	}
	public void mouseMoved(MouseEvent e) {
		Grapher.flowGraphEngine.getCanvas().mouseMoved(new MyPoint(e.getPoint().x,e.getPoint().y));
	}
	
	
	public void mouseDblClicked(MouseEvent   e){
		Grapher.flowGraphEngine.getCanvas().mouseDblClick(new MyPoint(e.getPoint().x,e.getPoint().y));
	}
	
	public void mouseClicked(MouseEvent   e){
		  if   (e.getClickCount()   ==   2)   {
			  mouseDblClicked( e);
		  }else{
			  Grapher.flowGraphEngine.getCanvas().mouseLeftClick(new MyPoint(e.getPoint().x,e.getPoint().y));
		  }
		
	}
}
